﻿namespace WatiN.Extensions.Tests
{
    using System.IO;

#if MSTest
    using Microsoft.VisualStudio.TestTools.UnitTesting;
#endif
#if NUnit
    using NUnit.Framework;
#endif
#if Xunit
    using Xunit;
#endif

    using WatiN.Core;

#if MSTest
    [TestClass]
#endif
    public class ElementContainerExtensionTests : WatiNTestBase
    {
#if MSTest
        private const string RootPath = "../../../";
#else
        private const string RootPath = "";
#endif

#if MSTest
        [TestMethod]
#endif
#if NUnit
        [Test]
#endif
#if Xunit
        [Fact]
#endif
        public void GetAllTest()
        {
            this.GoTo(GetPath("Site/Index.html"));

            var links = this.GetAllByClass<Link>("link");
#if !Xunit
            Assert.AreEqual(2, links.Count);
#else
            Assert.Equal(2, links.Count);
#endif
        }

        private static string GetPath(string filePath)
        {
            return Path.GetFullPath(string.Format("{0}{1}", RootPath, filePath));
        }
    }
}
